package DataModel
{
	import flash.errors.IllegalOperationError;
		
	public final class ApplicationMode
	{
		public static const Validation:ApplicationMode = new ApplicationMode("Validation");
		public static const DataEntry:ApplicationMode = new ApplicationMode("Data Entry");
		public static const ReadOnly:ApplicationMode = new ApplicationMode("Read Only");
		
		private var m_value:String;
		
		private static var locked:Boolean = false;
		
		// static initialization block to lock the class and prevent any 
		// further instantiation.
	    {
	      locked = true;
	    }
	    
	    // AS3 doesn't allow private constructors!!!
		public function ApplicationMode(value:String = null):void
		{
			if(locked)
			{
				throw new IllegalOperationError("You can't instantiate ApplicationMode");
			}
			m_value = value;
		}
		
		public function toString():String
		{
			return m_value;
		}	
	}
}